﻿using System;
using System.Data.OracleClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBUtility;

namespace OracleDAL.QuanXian
{
    public class Login
    {
        #region 得到用户信息
        public OracleDataReader GetUserInfo(string userisn)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select distinct userisn,username,unitisn,unitname,Password,IPSection FROM sec_userinfo WHERE userisn = '" + userisn + "'");

            return OracleHelper.ExecuteReader(strSql.ToString());
        }
        #endregion

        #region 获取节点
        public OracleDataReader GetNode(string unitisn)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select s.*,n.nodelevel,n.nodetype from sec_unit s,sec_node n ");
            strSql.Append("where s.unitisn = '" + unitisn + "'");
            strSql.Append("and s.upnodeid = n.nodeid ");

            return OracleHelper.ExecuteReader(strSql.ToString());
        }
        #endregion
    }
}
